<?php

/**
 * database作为session存储
 */

require_once 'Session_Storage.interface.php';

class DB_session implements session_storage
{
    private $_db;

    public function __construct()
    {
        $this->_db = DB::getInstance();
    }

    // 从存储中取session
    private function fetch_session($session_id)
    {
        $data = array();
        // get data from db ...
        
        return $data;
    }

    // 保存session到存储
    private function save_session($session_id, $data)
    {
        // save data to db ...

        return true;
    }
}

?>